<%@page import="com.grupo.model.VO.Prova"%>
<%@page import="com.grupo.model.DAO.ProvaDAO"%>
<%@page import="java.util.List"%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@include file="header.jsp" %>
<%@include file="topo.jsp" %>
<%@include file="menu.jsp" %>
<body>
    <%

        out.println(request.getAttribute("mensagem"));

    %>
    <form action="Controlador" method="post">            
        nome <input type="text" name="nome"/>
        telefone <input type="text" name="telefone"/>
        <input type="hidden" value="cad" name="op"/>     
        <input type="submit" value="cadastrar"/>
    </form>


    <table border="2">
        <tr>

            <th> id </th>
            <th>nome</th>
            <th>telefone</th>
            <th>alterar</th>
            <th>excluir</th>

        </tr>
        <%

            try {
                ProvaDAO cd = new ProvaDAO();
                List<Prova> lista = cd.listaClientes();

                for (Prova c : lista) {


        %>
        <tr>

            <td><%= c.getId()%></td>
            <td><%= c.getNome()%></td>
            <td><%= c.getTelefone()%></td>
            <td><%out.print("<a href=alterarCli.jsp?id=" + c.getId() + ">alterar</a>");%></td>
            <td><%out.print("<a href=Controlador?op=excluir&id=" + c.getId() + ">excluir</a>");%></td>


        </tr> 

        <%
                }
            } catch (Exception e) {
                out.print("Erro" + e.getMessage());
            }
        %>


    </table>
    <%@include file="rodape.jsp" %>
</body>
</html>
